package conexao;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;


public class ConnectionFactory {
	public Connection getConnection() throws ClassNotFoundException{

		String banco="LivrosSociaisLivros";
		String drive = "org.postgresql.Driver";
		String user = "postgres";
		String senha = "doaldo07011992";
		String url = "jdbc:postgresql://localhost:5432/";
		
		
			try {
				
				Class.forName(drive);
				Connection con = null;
				
				con = (Connection) DriverManager.getConnection(url+banco,user,senha);
				
				return con;
			} catch (SQLException e) {
				throw new RuntimeException(e);
			}
		
		
		
	}
}
